//
// Created by xkj on 2020/9/27.
//

#ifndef PROJ_ANDROID_SIOCOMMENTLIST_H
#define PROJ_ANDROID_SIOCOMMENTLIST_H

#include <string>
#include <vector>

#include "SIOUserInfo.h"

class SIOCommentListMsgBody {
public:
    std::string canvasId;
    std::string msgBody;
    std::string msgType;
    int id;
    unsigned long timestamp;

    SIOCommentListMsgBody& operator=(const SIOCommentListMsgBody& oneB)
    {
        // 避免自赋值
        if (this != &oneB)
        {
            canvasId = oneB.canvasId;
            msgBody = oneB.msgBody;
            msgType = oneB.msgType;
            timestamp = oneB.timestamp;
        }

        return *this;
    }
};

class SIOCommentList {
public:
    SIOUserInfo userInfo;
    SIOCommentListMsgBody msg;

    SIOCommentList& operator=(const SIOCommentList& oneB)
    {
        // 避免自赋值
        if (this != &oneB)
        {
            userInfo = oneB.userInfo;
            msg = oneB.msg;
        }

        return *this;
    }
};

class SioPageStatInfo
{
public:
    unsigned int redNum;
    unsigned int commentNum;
    unsigned int visitNum;
    std::vector<SIOCommentList> commentListVec;

    void init()
    {
        redNum = 0;
        commentNum = 0;
        visitNum = 0;

        commentListVec.clear();
    }

};
//{"avatar":"avatar","nickname":"nickname","gender":"gender","signature":"signature","role":"ND_PAD","roomId":"fake-channel-name","lastSign":"","msg":{"msgType":"msg","timestamp":1601031374,"canvasId":"oneCanvasId","msgBody":"发射爱心"}}
#endif //PROJ_ANDROID_SIOCOMMENTLIST_H
